package cn.shenlong.portal.service;

import java.util.List;
import java.util.Map;

import org.springframework.transaction.annotation.Transactional;

import cn.shenlong.common.Page;
import cn.shenlong.common.Pagination;
import cn.shenlong.portal.domain.Member;

public interface MemberService {

	/**
	 * 保存会员
	 * 
	 * @param member
	 */
	public void save(Member member, long memberId);

	/**
	 * 显示分页数据
	 * 
	 * @param Member
	 * @return
	 */
	public Pagination findMember(Member member, Map<String, Object> otherParm, Integer pageSize, Integer pageNo);
	
	public Page<Member> findPageByParm(Map<String, Object> otherParm, Integer pageNo, Integer pageSize);

	/**
	 * 查询内容
	 * 
	 * @param MemberId
	 * @return
	 */
	public Member findMemberByMemberId(long memberId);

	public Member updateMember(Member member);

	public void deleteMember(Long[] memberId);

	public void deleteByMemberId(List<Long> MemberId);

	public void save(Member member);
	
	/**
	 * 会员登录，返回会员对象
	 * @param loginName 登录名
	 * @param password 密码
	 * @return 会员对象
	 */
	public Member login(String loginName,String password);
	
	/**
	 * 根据登录名查询会员数量，防止注册时出现重复的用户
	 * @param loginName 登录名
	 * @return
	 */
	public Long findMemberCountByName(String loginName);
	
	/**
	 * 验证邮箱是否存在
	 * @param email 邮箱
	 * @return
	 */
	public Member findByEmail(String email);
	
	/**
	 * 验证邮箱是否存在
	 * @param email 邮箱
	 * @param memberId 过滤掉自己的ID
	 * @return
	 */
	public Member findByEmailIgnoreId(String email, Long memberId);
	
	/**
	 * 绑定会员卡
	 * @param memberId 会员ID
	 * @param memberCardCode 会员卡号
	 */
	public void bingMemberCard(Long memberId, String memberCardCode);
	
	public int unbind(Long memberId);
	
	/**
	 * 根据用户名称查找用户
	 * @param memberName 用户名
	 * @return
	 */
	public Member findMemberByName(String memberName);
}
